#! /bin/sh

name=sdl2-compat
version=2.32.56
revision=1
tarball_url="https://github.com/libsdl-org/sdl2-compat/releases/download/release-${version}/sdl2-compat-${version}.tar.gz"
tarball_blake2b="ffe635f2f2f220715752185587a4c4cc343acbfe1c17cd96afe176a65354926902b9d26d09c1688130a74561036da808aadc2f93467d4634bf692ffe69b26e57"
imagedeps="cmake ninja-build git"
hostdeps="gcc pkg-config"
deps="sdl3"

configure() {
    cmake_configure \
        -DSDL2COMPAT_STATIC=OFF \
        -DSDL2COMPAT_TEST_LIBRARY=OFF
}

build() {
    ninja -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" ninja install

    rm -v "${dest_dir}${prefix}"/lib/*.a

    post_package_strip
}
